<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>mergeProps</title>
</head>

<body>
    <div id="app">
        <input type="button" value="测试01" @click="test.onClick">
    </div>
</body>

<script src="./js/vue.global.js"></script>
<script>
    const { createApp, mergeProps } = Vue

    const one = {
        class: 'foo',
        onClick: () => {
            console.log(1)
        }
    }

    const two = {
        class: { bar: true },
        onClick: () => {
            console.log(2)
        }
    }
    const test = mergeProps(one, two)

    console.log(test) // { class: 'foo bar', onClick: [() => {console.log(1)}, () => {console.log(2)}]}
    
    const app = createApp({
        data() {
            return {
                test
            }
        }
    })

    app.mount('#app')
</script>

</html>